﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="VerFotografias.aspx.cs" Inherits="ProjectoPV_ESW.Account.Fotografias.VerFotografias" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div align="center">
    <h1 align="center">
        Ver listagem de fotografias</h1>
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
        DataKeyNames="FotoId" DataSourceID="SqlDataSource1" ForeColor="#333333" 
        GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="FotoId" HeaderText="FotoId" InsertVisible="False" 
                ReadOnly="True" SortExpression="FotoId" />
            <asp:BoundField DataField="Path" HeaderText="Path" SortExpression="Path" />
            <asp:BoundField DataField="Descricao" HeaderText="Descricao" 
                SortExpression="Descricao" />
            <asp:BoundField DataField="DataFoto" HeaderText="DataFoto" 
                SortExpression="DataFoto" />
            <asp:BoundField DataField="Sala_SalaId" HeaderText="Sala_SalaId" 
                SortExpression="Sala_SalaId" />
            <asp:BoundField DataField="Crianca_CriancaId" HeaderText="Crianca_CriancaId" 
                SortExpression="Crianca_CriancaId" />
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:JardimEntitiesString %>" 
        DeleteCommand="DELETE FROM [Foto] WHERE [FotoId] = @FotoId" 
        InsertCommand="INSERT INTO [Foto] ([Path], [Descricao], [DataFoto], [Sala_SalaId], [Crianca_CriancaId]) VALUES (@Path, @Descricao, @DataFoto, @Sala_SalaId, @Crianca_CriancaId)" 
        ProviderName="<%$ ConnectionStrings:JardimEntitiesString.ProviderName %>" 
        SelectCommand="SELECT * FROM [Foto]" 
        UpdateCommand="UPDATE [Foto] SET [Path] = @Path, [Descricao] = @Descricao, [DataFoto] = @DataFoto, [Sala_SalaId] = @Sala_SalaId, [Crianca_CriancaId] = @Crianca_CriancaId WHERE [FotoId] = @FotoId">
        <DeleteParameters>
            <asp:Parameter Name="FotoId" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Path" Type="String" />
            <asp:Parameter Name="Descricao" Type="String" />
            <asp:Parameter Name="DataFoto" Type="DateTime" />
            <asp:Parameter Name="Sala_SalaId" Type="Int32" />
            <asp:Parameter Name="Crianca_CriancaId" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Path" Type="String" />
            <asp:Parameter Name="Descricao" Type="String" />
            <asp:Parameter Name="DataFoto" Type="DateTime" />
            <asp:Parameter Name="Sala_SalaId" Type="Int32" />
            <asp:Parameter Name="Crianca_CriancaId" Type="Int32" />
            <asp:Parameter Name="FotoId" Type="Int32" />
        </UpdateParameters>
        
    </asp:SqlDataSource>
    </div>
</asp:Content>
